package main

import (
	"embed"

	"github.com/wailsapp/wails/v2"
	"github.com/wailsapp/wails/v2/pkg/options"
)

//go:embed all:frontend/dist
var assets embed.FS

//go:embed build/appicon.png
var icon []byte

func main() {
	// Create an instance of the app structure
	app := NewApp()

	// Create application with options
	err := wails.Run(&options.App{
		Title:            "gowatcher",
		Width:            GetWindowWidth(),
		Height:           GetWindowHeight(),
		Assets:           assets,
		BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
		OnStartup:        app.startup,
		Frameless:        true,
		Bind: []interface{}{
			app,
		},
	})

	if err != nil {
		println("Error:", err.Error())
	}
	// var data = map[string]string{
	// 	"window-width":  "1080",
	// 	"window-height": "1020",
	// }

	// e := DbPut(data)
	// if e != zerr.SUCCESS {
	// 	log.Println("main1: " + zerr.GetMsg(e))
	// }
	// log.Println("main2:" + zerr.GetMsg(e))
	// println(GetWindowWidth(), GetWindowHeight())

}
